package com.aloha.minio.entity;

import com.aloha.minio.config.MinioConfigProperties;

/**
 * @author DaiZhiHeng
 * @description 响应结果
 * @date 2023/4/5 14:26
 */
public class MinioResult {

    /**
     * minion服务器：http://ubuntu.server:9000
     */
    private String server;

    /**
     * 桶
     */
    private String bucket;

    /**
     * 文件的位置
     */
    private String filePath;

    /**
     * 访问链接
     */
    private String url;

    public MinioResult build(MinioConfigProperties properties, String filePath) {
        this.bucket = properties.getBucket();
        this.server = properties.getEndpoint();
        this.filePath = filePath;
        this.url = this.server + "/" + this.bucket + "/" + this.filePath;
        return this;
    }

    public String getServer() {
        return server;
    }

    public void setServer(String server) {
        this.server = server;
    }

    public String getBucket() {
        return bucket;
    }

    public void setBucket(String bucket) {
        this.bucket = bucket;
    }

    public String getFilePath() {
        return filePath;
    }

    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }
}
